<?php

echo __LINE__;
echo "\n\n";
echo __FILE__;
echo "\n\n";
echo __DIR__;
echo "\n\n";
echo anyFun();// will print function name
echo "\n\n";
$obj = new Foo();
echo $obj->anyMethod();// will print function name
echo "\n\n";
//////////////////////////////////////////
function anyFun() {
  echo __FUNCTION__;
}

class Foo{
  function anyMethod() {
    echo __METHOD__;
  }
}
